package com.brightworks.scripthelper.analyzers
{
    import com.brightworks.scripthelper.constants.LineTypeConstants;
    import com.brightworks.util.Log;
    import com.brightworks.util.Utils_String;

    public class LineTypeAnalyzer_Header_LessonName extends LineTypeAnalyzer
    {
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
        //
        //          Getters & Setters
        //
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

        public static function get lineTypeDescription():String
        {
            return LineTypeConstants.LINE_TYPE_DESCRIPTION__HEADER__LESSON_NAME;
        }

        public static function get lineTypeId():String
        {
            return LineTypeConstants.LINE_TYPE_ID__HEADER__LESSON_NAME;
        }

        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
        //
        //          Public Methods
        //
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

        public function LineTypeAnalyzer_Header_LessonName()
        {
            super();
        }

        public function getLessonName():String
        {
            if (lineText.indexOf("Lesson Name: ") != 0)
                return "";
            var result:String = lineText.substring(13, lineText.length);
            result = Utils_String.removeWhiteSpaceIncludingLineReturnsFromBeginningAndEndOfString(result);
            return result;
        }

        override public function getProblemReports():Array
        {
            var problemList:Array = [];
            if (lineText.indexOf("Lesson Name: ") != 0)
                problemList.push("Based on its position as the 2nd line in the script, this line should be the " + LineTypeConstants.LINE_TYPE_DESCRIPTION__HEADER__LESSON_NAME + ", but this doesn't seem to be the case.");
            return constructFullProblemStrings(problemList);
        }

        public static function isLineThisType(lineString:String, lineStringList:Array=null, lineNum:int=-1):Boolean
        {
            // We use another, external, method to determine this at this point, so this method isn't used.
            Log.fatal("LineTypeAnalyzer_Header_LessonName.isLineThisType(): Method not implemented");
            return false;
        }

        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
        //
        //          Private Methods
        //
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

    }
}

